﻿@model Tasks.UI.Models.DictManageModel
@{
    ViewBag.Title = "ManageTemplate";
}
<html>
<head>
    <title>DictManage</title>
    <link href="@Config.GetCssResourcePath("main.css")" rel="stylesheet" type="text/css" />
    <link href="@Config.GetCssResourcePath("table.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/themes/base/jquery.ui.all.css")" rel="stylesheet" type="text/css" />
    
    <script src="@Url.Content("~/Scripts/jquery-1.5.1.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery-ui-1.8.11.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.checked.ManageTemplate.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/global.js")" type="text/javascript"></script>
    <style type="text/css">
        *
        {
            margin: 0;
            padding: 0;
        }
        .container
        {
            width: 100%;
            padding: 10px 0px 0px 10px;
        }
        .info textarea
        {
            width: 100%;
        }
    </style>
</head>
<body>
    <form action="ManageTemplate" method="post">
    <div id="container">
        <div class="navTitle">
            模板管理</div>
        <div>
            <label>
                名称：</label>
            @Html.TextBox("Content")
            <input type="submit" value="查询" class="btnSearch" />
            <input id="act" name="act" type="hidden" />
            <input id="DictID" name="DictID" type="hidden" />
        </div>
        <table class="tblStyle1" border="1" style="table-layout: fixed; width: 100%;" id="tb">
            <thead>
                <tr>
                    <th style="width: 40px">
                        序号
                    </th>
                    <th>
                        内容
                    </th>
                    <th style="width: 100px">
                        操作
                    </th>
                </tr>
            </thead>
            <tbody>
                <tr style="display: none;">
                    <td class="info" name="SNO">
                        <textarea id="SNO" cols="20" rows="2" name="SNO" style="width: 400px; height: 200px"></textarea>
                    </td>
                    <td class="info" name="Content">
                        <textarea id="Content" cols="20" rows="2" name="Content" style="width: 400px; height: 200px"></textarea>
                        @Html.Hidden("DictKey")
                    </td>
                    <td>
                        <input type="hidden" value="0" />
                        <a href="javascript:void(0)" onclick="editRow(this)" class="btnEdit" style="display: none">
                            编辑</a> <a href="javascript:void(0)" onclick="setRowState(this,0)" class="btnCanelEdit">
                                取消</a> <a href="javascript:void(0)" onclick="delRow(this)" class="delRow" style="display: none">
                                    删除</a> <a href="javascript:void(0)" onclick="saveRow(this)" class="btnSaveRow">保存</a>
                    </td>
                </tr>
                @foreach (DictValue dict in Model.Dicts)
                { 
                    <tr class="edit" id="tpl">
                        <td class="info" name="SNO">
                            @dict.SNO
                        </td>
                        <td class="info" name="Content">
                            @dict.Content
                        </td>
                        <td>
                            <input id="ID" type="hidden" value="@dict.ID" name="ID"/>
                            <a href="javascript:void(0)" onclick="editRow(this)" class="btnEdit">编辑</a> <a href="javascript:void(0)"
                                onclick="setRowState(this,0)" class="btnCanelEdit" style="display: none">取消</a>
                            <a href="javascript:void(0)" onclick="delRow(this)" class="delRow">删除 </a><a href="javascript:void(0)"
                                onclick="saveRow(this)" style="display: none" class="btnSaveRow">保存</a>
                        </td>
                    </tr>
                }
            </tbody>
        </table>
        @Html.RenderPageNav(Model.PageIndex, Model.PageSize, Model.RowCount, "", PageNavStyle.Form)
        <br />
        <a href="javascript:addRow()">添加</a>
    </div>
    </form>
</body>
</html>
